package top.hidoctor.auscultation.adapter;

import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import top.hidoctor.auscultation.R;
import top.hidoctor.auscultation.bean.LableBean;

public class GongzuotaiBzAdapter extends BaseQuickAdapter<LableBean.SampleBean> {

    public GongzuotaiBzAdapter(int layoutResId, List<LableBean.SampleBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, LableBean.SampleBean item) {
        helper.setOnClickListener(R.id.btn_shenhe, new OnItemChildClickListener());
        helper.setText(R.id.tv_no, item.getNo())
                .setText(R.id.tv_tiwei, "体位：" + item.getPosition())
                .setText(R.id.tv_peihe, "配合程度：" + item.getCoordinate())
                .setText(R.id.btn_shenhe, item.getLabelStatus() == 10 ? "标注" : item.getLabelStatus() == 20 ? "查看" : item.getLabelStatus() == 30 ? "超时" : "")
                .setBackgroundRes(R.id.btn_shenhe, item.getLabelStatus() == 10 ? R.drawable.btn_bg_8 : item.getLabelStatus() == 20 ?
                        R.drawable.btn_bg_yollow_8 : item.getLabelStatus() == 30 ? R.drawable.btn_bg_red_8 : null);
    }
}
